package com.syl.ippool;

import com.syl.ippool.graspimpl.GraspManager;
import com.syl.ippool.poolimpl.SetIPPool;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

/**
 * 系统启动入库
 *
 */
@SpringBootApplication
@ComponentScan(basePackages = {"com.syl.ippool"})
public class ApplicationStart {

    // 应用程序 ip池
    public static volatile SetIPPool setIPPool = null;

    public static void main(String[] args) {
        System.out.println("master");
        // 启动服务器
        SpringApplication.run(ApplicationStart.class, args);

        // 启动线程池
        setIPPool = new SetIPPool();
        GraspManager graspManager = new GraspManager(setIPPool);
        graspManager.register();
        graspManager.run();
        System.out.println("222222");
        System.out.println("devdevdev");
        System.out.println("222222222222222222");
    }
}
